home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / RIncludes / LocationManager.r < prev    next >
Encoding:
Text File  |  1998-02-12  |  6.3 KB  |  172 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        LocationManager.r
  3.  
  4.      Contains:    LocationManager (old name; use SettingsManager instead)
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18.  
  19. #ifndef __LOCATIONMANAGER_R__
  20. #define __LOCATIONMANAGER_R__
  21.  
  22. #ifndef __CONDITIONALMACROS_R__
  23. #include "ConditionalMacros.r"
  24. #endif
  25.  
  26. /* Location Manager API Support -------------------------------------------------------------------- */
  27. /* A Location Token uniquely identifies a Location on a machine... */
  28.  
  29. #define kALMNoLocationToken             (-1)                /*  ALMToken of "off" Location... */
  30. #define kALMLocationNameMaxLen             31                    /*  name (actually imposed by file system)...  */
  31. #define kALMNoLocationIndex             (-1)                /*  index for the "off" Location (kALMNoLocationToken)...  */
  32.  
  33. /* Returned from ALMConfirmName... */
  34. #define kALMConfirmRename                 1
  35. #define kALMConfirmReplace                 2
  36.  
  37. /* ALMConfirmName dialog item numbers for use in callbacks (ALM 2.0)... */
  38.  
  39. #define kALMDuplicateRenameButton         1                    /*  if Window refcon is kALMDuplicateDialogRefCon...  */
  40. #define kALMDuplicateReplaceButton         2
  41. #define kALMDuplicateCancelButton         3
  42. #define kALMDuplicatePromptText         5
  43.  
  44. #define kALMRenameRenameButton             1                    /*  if Window refcon is kALMRenameDialogRefCon...  */
  45. #define kALMRenameCancelButton             2
  46. #define kALMRenameEditText                 3
  47. #define kALMRenamePromptText             4
  48.  
  49. /* Refcons of two windows in ALMConfirmName (ALM 2.0)... */
  50.  
  51. #define kALMDuplicateDialogRefCon         'dupl'
  52. #define kALMRenameDialogRefCon             'rnam'
  53.  
  54. /* Callback routine for Location awareness (mimics AppleEvents) in non-application code... */
  55.  
  56. /* Notification AppleEvents sent to apps/registered code...  */
  57. #define kAELocationChangedNoticeKey     'walk'                /*  Current Location changed...  */
  58. #define kAELocationRescanNoticeKey         'trip'                /*  Location created/renamed/deleted...  */
  59.  
  60. /* ALMSwitchToLocation masks... */
  61.  
  62. #define kALMDefaultSwitchFlags             0x00000000            /*  No special action to take...  */
  63. #define kALMDontShowStatusWindow         0x00000001            /*  Suppress "switching" window...  */
  64. #define kALMSignalViaAE                 0x00000002            /*  Switch by sending Finder AppleEvent...  */
  65.  
  66. /* Parameters for Get/Put/Merge Location calls... */
  67.  
  68. #define kALMAddAllOnSimple                 0                    /*  Add all single-instance, non-action modules...  */
  69. #define kALMAddAllOff                     (-1)                /*  Add all modules but turn them off...  */
  70.  
  71. /* Item numbers for use in Get/Put/Merge Location filters... */
  72.  
  73. #define kALMLocationSelectButton         1
  74. #define kALMLocationCancelButton         2
  75. #define kALMLocationBalloonHelp         3
  76. #define kALMLocationLocationList         7
  77. #define kALMLocationLocationNameEdit     10
  78. #define kALMLocationPromptText             11
  79.  
  80. #define kALMLocationSaveButton             1
  81. /* Location Manager Module API Support ------------------------------------------------------------- */
  82.  
  83. /* ALMGetScriptInfo stuff... */
  84.  
  85. #define kALMScriptInfoVersion             2                    /*  Customarily put in resource for localization...  */
  86. /*
  87.    Alternate form of ScriptInfo is easier to localize in resources; it is used extensively in
  88.    samples and internally, so....
  89. */
  90. #define kALMAltScriptManagerInfoRsrcType  'trip'
  91. #define kALMAltScriptManagerInfoRsrcID     0
  92.  
  93. type kALMAltScriptManagerInfoRsrcType {
  94.     integer;    // version = kALMScriptInfoVersion
  95.     integer;    // scriptCode (eg. smRoman)
  96.     integer;     // regionCode (eg. versUS)
  97.     integer;     // langCode (eg. langEnglish)
  98.     integer;    // fontSize
  99.     pstring;    // fontName
  100. };
  101. /* Reboot information used on ALMSetCurrent (input/output parameter)... */
  102.  
  103. #define kALMNoChange                     0
  104. #define kALMAvailableNow                 1
  105. #define kALMFinderRestart                 2
  106. #define kALMProcesses                     3
  107. #define kALMExtensions                     4
  108. #define kALMWarmBoot                     5
  109. #define kALMColdBoot                     6
  110. #define kALMShutdown                     7
  111.  
  112. /*
  113.    File types and signatures...
  114.    Note: auto-routing of modules will not be supported for 'thng' files...
  115. */
  116.  
  117. #define kALMFileCreator                 'fall'                /*  Creator of Location Manager files...  */
  118. #define kALMComponentModuleFileType     'thng'                /*  Type of a Component Manager Module file [v1.0]...  */
  119. #define kALMComponentStateModuleFileType  'almn'            /*  Type of a CM 'state' Module file...  */
  120. #define kALMComponentActionModuleFileType  'almb'            /*  Type of a CM 'action' Module file...  */
  121. #define kALMCFMStateModuleFileType         'almm'                /*  Type of a CFM 'state' Module file...  */
  122. #define kALMCFMActionModuleFileType     'alma'                /*  Type of a CFM 'action' Module file...  */
  123.  
  124. /* Component Manager 'thng' info... */
  125.  
  126. #define kALMComponentRsrcType             'thng'
  127. #define kALMComponentType                 'walk'
  128.  
  129. /* CFM Modules require a bit of information (replacing some of the 'thng' resource)... */
  130.  
  131. #define kALMModuleInfoRsrcType             'walk'
  132. #define kALMModuleInfoOriginalVersion     0
  133.  
  134. type kALMModuleInfoRsrcType {
  135.     switch {
  136.         case Original:
  137.             key longint = kALMModuleInfoOriginalVersion;
  138.             literal longint;         // Subtype
  139.             literal longint;         // Manufacturer
  140.             unsigned hex longint;     // Flags
  141.     };
  142. };
  143. /* These masks apply to the "Flags" field in the 'thng' or 'walk' resource... */
  144.  
  145. #define kALMMultiplePerLocation         0x00000001            /*  Module can be added more than once to a Location...  */
  146. #define kALMDescriptionGetsStale         0x00000002            /*  Descriptions may change though the setting didn't...   */
  147.  
  148. /* Misc stuff for older implementations ------------------------------------------------------------ */
  149.  
  150. /* Old error codes for compatibility - new names are in Errors interface... */
  151. #if OLDROUTINENAMES
  152. #define ALMInternalErr                     (-30049)            /*  use kALMInternalErr  */
  153. #define ALMLocationNotFound             (-30048)            /*  use kALMLocationNotFoundErr  */
  154. #define ALMNoSuchModuleErr                 (-30047)            /*  use kALMNoSuchModuleErr  */
  155. #define ALMModuleCommunicationErr         (-30046)            /*  use kALMModuleCommunicationErr  */
  156. #define ALMDuplicateModuleErr             (-30045)            /*  use kALMDuplicateModuleErr  */
  157. #define ALMInstallationErr                 (-30044)            /*  use kALMInstallationErr  */
  158. #define ALMDeferSwitchErr                 (-30043)            /*  use kALMDeferSwitchErr  */
  159.  
  160. /* Old ALMConfirmName constants... */
  161.  
  162. #define ALMConfirmRenameConfig             1
  163. #define ALMConfirmReplaceConfig         2
  164.  
  165. /* Old AppleEvents... */
  166.  
  167. #define kAELocationNotice                 'walk'
  168. #endif
  169.  
  170. #endif /* __LOCATIONMANAGER_R__ */
  171.  
  172.